﻿using AntdUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lima.ResumeSys.Models
{
    public class PersonInfo : NotifyProperty
    {
        public string PerNo { get; set; }

        public string PerName { get; set; }

        public string PerSex { get; set; }

        public DateTime PerBirth { get; set; }

        public string PerFormerName { get; set; }

        public string PerPhoto { get; set; }
        public string PerNationality { get; set; }

        public string PerIdCard { get; set; }

        public string PerNativePlace { get; set; }

        public string PerMaritalStatus { get; set; }

        public string PerEducationLevel { get; set; }

        public string PerPoliticalStatus { get; set; }

        public DateTime? PerJoinPartyTime { get; set; }

        public DateTime PerWorkStartTime { get; set; }

        public string PerUnitNature { get; set; }

        public string PerJobPosition { get; set; }

        public string PerJobLevel { get; set; }

        public string PerJobTitle { get; set; }

        public string PerManagementWork { get; set; }

        public DateTime? PerTenureTime { get; set; }

        public string PerAddress { get; set; }

        public string Creator { get; set; }

        public DateTime CreateTime { get; set; } = DateTime.Now;

        public string UpdatedBy { get; set; }

        public DateTime UpdateTime { get; set; }
        public string PerOrgId { get; set; }
        public string PerOrgName { get; set; }

        public string PerBirthText =>this.PerBirth.ToString("d");

        public string PerTenureTimeText => this.PerTenureTime.HasValue ? this.PerTenureTime.Value.ToString("d") : "";


        private CellLink[] cellLinks;
        public CellLink[] CellLinks
        {
            get { return cellLinks; }
            set
            {
                if (cellLinks == value) return;
                cellLinks = value;
                OnPropertyChanged(nameof(CellLinks));
            }
        }

    }

    public class QueryPersonInfoModel
    {
        public string PerName { get; set; }

        public string PerIdCard { get; set; }
        /// <summary>
        /// 组织结构ID
        /// </summary>
        public string PerOrgId { get; set; }

        public int CurrentPage { get; set; } = 1;

        public int PageSize { get; set; } = 5;
    }

    public class PersonPageResult
    {
        public List<PersonInfo> Data { get; set; } = new List<PersonInfo>();

        public int Total { get; set; }
        public int PageSize { get; set; }
        public int CurrentPage { get; set; }
    }
}
